Removed deadlock and added more options