updated with new code for spring