Figured out problem in code