Fixed flow of control; everything should work as intended now!